package com.zj.recyclerviewdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.zj.recyclerviewdemo.adapter.Main2Adapter;
import com.zj.recyclerviewdemo.view.Main2Activity;
import com.zj.recyclerviewdemo.view.Main3Activity;
import com.zj.recyclerviewdemo.view.MainActivity;

public class ChooseActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnActivity;
    private Button btnFragment;
    private Button btnViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose);

        btnActivity = (Button)findViewById(R.id.btn_activity);
        btnFragment = (Button)findViewById(R.id.btn_fragment);
        btnViewPager = (Button)findViewById(R.id.btn_view_pager);

        btnActivity.setOnClickListener(this);
        btnFragment.setOnClickListener(this);
        btnViewPager.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_activity:
                Intent intent = new Intent(this, MainActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_fragment:
                Intent intent1 = new Intent(this, Main2Activity.class);
                startActivity(intent1);
                break;
            case R.id.btn_view_pager:
                Intent intent2 = new Intent(this, Main3Activity.class);
                startActivity(intent2);
                break;
        }
    }
}
